package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.User;
import com.heima.pojo.dto.LoginDto;
import com.heima.pojo.dto.PageUserQueryDTO;
import com.heima.pojo.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from tb_user where login_name = #{loginName}")
    User userGetLogin(LoginDto dto);

    Page<User> userQuery(PageUserQueryDTO dto);


    Page<UserVo> userPageQuery(PageUserQueryDTO dto);

    List<UserVo> userCount();

    @Select("select * from tb_user where id = #{id}")
    User queryUserById(Integer id);
}
